Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="../../ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ var div = $("div"); startAnimation(); showQueue(); function startAnimation(){ div.animate({height:300},"slow"); div.animate({width:300},"slow"); div.animate({height:100},"slow"); div.animate({width:100},"slow",startAnimation); } function showQueue(){ var q=div.queue(); $("span").text(q.length); setTimeout(showQueue); } }); }); </script> </head> <body> <button>Start Animation</button> <p>The queue length is: <span></span></p> <div style="width:50px;height:50px;position:absolute;left:10px;top:100px;background-color:red;"></div> </body> <!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_eff_queue2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:15:19 GMT --> </html>
Result:
Try it Yourself - © w3schools.com